home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 49 / Amiga Format CD49 (2000-01-17)(Future Publishing)(GB)(Track 1 of 3)[!][issue 2000-02].iso / -websites- / wirenet / files / updatewirenet.lzx / Updates / Dashboard < prev    next >
Text File  |  2004-06-20  |  4KB  |  180 lines

  1. /* $VER: Dashboard 1.3  (30.05.96) (c) Neil Bothwick */
  2. /* Central interface for Wirenet Internet operation  */
  3.  
  4. options results
  5.  
  6. GuiFile = 'AmiTCP:dashboard.gui'
  7. cr = '0a'x
  8. pragma('Directory','AmiTCP:bin')
  9.  
  10. if ~show('L','rexxsupport.library') then
  11.     if ~addlib('rexxsupport.library',0,-30) then exit
  12.  
  13. if ~show('L','rexxdossupport.library') then
  14.     if ~addlib('rexxdossupport.library',0,-30) then exit
  15.  
  16. if ~show('L','rexxreqtools.library') then
  17.     if ~addlib('rexxreqtools.library',0,-30) then exit
  18.  
  19. /* Load Varexx if necessary */
  20.  
  21. if ~show('P','VAREXX') then do
  22.     VarexxStarted = 'Yes'
  23.     address command 'Varexx'
  24.     address command 'WaitForPort VAREXX'
  25.     end
  26.  
  27. address VAREXX
  28.  
  29. call openport('DashPort')
  30.  
  31. 'load' GuiFile 'DashPort'
  32. host = result
  33. address value host
  34.  
  35. show 'Dashboard'
  36. call EnableAll(1)
  37. Busy SET
  38. address command 'StartNet'
  39. Busy
  40.  
  41. do forever
  42.     call waitpkt('DashPort')
  43.     packet = getpkt('DashPort')
  44.     Action = getarg(packet)
  45.  
  46.     select
  47.         when Action = 'CONNECT' then call Connect
  48.         when Action = 'DISCONNECT' then call Disconnect
  49.         when Action = 'GET' then call Get
  50.         when Action = 'BROWSE' then call Browse
  51.         when Action = 'FTP' then call FTP
  52.         when Action = 'WWW' then call WWW
  53.         when Action = 'READ' then call Read
  54.         when Action = 'EXIT' then call Exit(0)
  55.         when Action = 'QUIT' then call Exit(1)
  56.         when Action = 'CLOSEWINDOW' then call Exit(0)
  57.         when Action = 'TITLE' then call About
  58.         otherwise nop
  59.         end
  60.     end
  61.  
  62. exit
  63.  
  64.  
  65. EnableAll:
  66.     arg flag
  67.     GadList = 'TITLE CONNECT CONNECTTYPE DISCONNECT DISCONNECTTYPE GET GETTYPE WWW FTP BROWSE READ EXIT QUIT'
  68.     if flag = 1 then
  69.         do i = 1 to words(GadList)
  70.             set word(GadList,i) enable
  71.             end
  72.     else
  73.         do i = 1 to words(GadList)
  74.             set word(GadList,i) disable
  75.             end
  76.     return
  77.  
  78. Connect:
  79.     Busy SET
  80.     read CONNECTTYPE
  81.     ConType = result
  82.     address command
  83.     select
  84.         when upper(GetVar(NetState)) = 'ONLINE' then call Request('You are already connected')
  85.         when ConType = 0 then 'Connect'
  86.         when ConType = 1 then 'Connect Mail'
  87.         when ConType = 2 then 'Connect News'
  88.         when ConType = 3 then 'Connect AutoMail'
  89.         when ConType = 4 then 'Connect AutoNews'
  90.         otherwise nop
  91.         end
  92.     address
  93.     Busy
  94.     return
  95.  
  96. Disconnect:
  97.     Busy SET
  98.     read DISCONNECTTYPE
  99.     DisconType = result
  100.     address command
  101.     if DisconType = 0 then 'Connect Off'
  102.     else 'Connect AutoOff'
  103.     address
  104.     Busy
  105.     return
  106.  
  107. FTP:
  108.     Busy SET
  109.     address command 'Run >NIL: AmiTCP:AmiFTP'
  110.     Busy
  111.     return
  112.  
  113. WWW:
  114.     Busy SET
  115.     address command 'Run >NIL: AmiTCP:AWeb/AWeb'
  116.     Busy
  117.     return
  118.  
  119. Get:
  120.     Busy SET
  121.     read GETTYPE
  122.     FetchType = result
  123.     address command
  124.     select
  125.         when FetchType = 0 then 'run >NIL: Fetch Mail'
  126.         when FetchType = 1 then 'run >NIL: Fetch News'
  127.         when FetchType = 2 then 'run >NIL: Fetch All'
  128.         otherwise nop
  129.         end
  130.     address
  131.     Busy
  132.     return
  133.  
  134. Read:
  135.     Busy SET
  136.     address command 'run >NIL: run >nil: `GetEnv THOR/THORPath`Thor System=Wirenet FF'
  137.     Busy
  138.     return
  139.  
  140. Browse:
  141.     if upper(GetVar(NetState)) ~= 'ONLINE' then do
  142.         call Request('You need to be connected'||cr||'     to use this function')
  143.         return
  144.         end
  145.     Busy SET
  146.     address command 'run >NIL: run >nil: `GetEnv THOR/THORPath`ConnectThor'
  147.     Busy
  148.     return
  149.  
  150. Exit:
  151.     parse arg Quit
  152.     Busy SET
  153.     if Quit = 1 & upper(GetVar(NetState)) = 'ONLINE' then do
  154.         if rtezrequest('This will disconnect you!'||cr||'Are you sure?',' _Yes |_No',,'rtez_defaultresponse=0') = 1 then call Disconnect
  155.         else do
  156.             Busy
  157.             return
  158.             end
  159.         end
  160.     'hide UNLOAD'
  161.     call closeport('DashPort')
  162.     if VarexxStarted = 'Yes' then address command 'SYS:Rexxc/VXC'
  163.     if Quit = 1 then address Command 'StopNet'
  164.     exit
  165.     return
  166.  
  167. About:
  168.     Busy SET
  169.     AboutMsg = 'Wirenet Dashboard (c) Neil Bothwick, 1996'cr|| cr'Created using Varexx by Andy Cook'cr'GadToolsBox by Jan van den Baard'
  170.     if rtezrequest(AboutMsg,' _OK |_Help',,'rt_reqpos=reqpos_centerwin') = 0 then
  171.         address command 'Multiview AmiTCP:doc/Dashboard.guide'
  172.     Busy
  173.     return
  174.  
  175. Request:
  176.     parse arg Message
  177.     call rtezrequest(Message,' _OK ')
  178.     return
  179.  
  180.